<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>不去管理平台</title>
    <link rel="stylesheet" href="{{asset('css/index/common.css')}}">
    <link rel="stylesheet" href="{{asset('css/register/regCommon.css')}}">
    <link rel="stylesheet" href="{{asset('css/register/register.css')}}">
</head>

<body>
    <header class="reg_head">
        <div class="reg_head_total">
            <div class="reg_big_title">
                <!--<h2 class="reg_big_title1">不去联盟</h2>-->
                <div class="reg_title_line">|</div>
                <h2 class="reg_big_title1">注册</h2>
            </div>
            <ul class="reg_little_title">
                <li class="rl_title"><a href="{{ route('login') }}">登录</a><span>-</span><a href="#" class="after_line">注册</a></li>
                {{--<li class="rl_title"><a href="#" class="after_line">我的</a></li>--}}
                {{--<li class="rl_title"><a href="#" class="after_line">服务大厅</a></li>--}}
                {{--<li class="rl_title"><a href="#" class="after_line">提建议</a></li>--}}
                {{--<li class="rl_title"><a href="#">更多</a></li>--}}
            </ul>
        </div>
    </header>
    <main class="reg_main">
        <!--进度条-->
        <div class="AccountTotal">
            <div class="regSorts">
                <div class="regSortsText">
                    <ul class="reg_steps">
                        <li class="reg_step">
                            <div class="reg_step_left">
                                <div class="reg_step_top active_back">1</div>
                                <p class="reg_step_bot active_color">创建账户</p>
                            </div>
                            <div class="reg_step_line"></div>
                        </li>
                        <li class="reg_step">
                            <div class="reg_step_left">
                                <div class="reg_step_top">2</div>
                                <p class="reg_step_bot">企业实名认证</p>
                            </div>
                            <div class="reg_step_line"></div>
                        </li>
                        <li class="reg_step">
                            <div class="reg_step_left">
                                <div class="reg_step_top">3</div>
                                <p class="reg_step_bot">审核中</p>
                            </div>
                            <div class="reg_step_line"></div>
                        </li>
                        <li class="reg_step reg_step_last">
                            <div class="reg_step_left">
                                <div class="reg_step_top">4</div>
                                <p class="reg_step_bot">成功</p>
                            </div>
                        </li>
                    </ul>
                    <div style="clear: both;height: 0;"></div>
                </div>
            </div>
            <!---->
            <div class="regAccount1">
                <div class="regAccount1_title">
                    <img src="{{asset('images/index/person.png')}}" alt="" class="account1_photo">
                    <h2 class="account1_title">商户账户</h2>
                </div>
                <div style="width:600px;line-height:30px; background-color:#DEF0D8;margin:0 auto;border-radius:2px; text-align:center;color:red;" id="err"></div>
                @include('shared.messages')
                @include('shared.errors')
                <div class="regAccount1_form">
                    <div style="margin:0 0 20px 100px;color: red">请使用天翼购账号注册</div>
                    <form action="{{ url('auth/register') }}" class="reg_form" method="post">
                     {{ csrf_field() }}
                        <div class="regAccount_form regAccount_form1">
                            <label for="area" class="rA_left_label">公司名称</label>
                            <input type="text" placeholder="请输入公司名称" class="rA_right_input email" name="firm" value="" reqiured id="firm">
                            <p class="regAccountToggle">请输入有效的公司名称</p>
                            <p class="regAccountPrompt">请输入正确的公司名称</p>
                        </div>
                        <div class="regAccount_form regAccount_form1">
                            <label for="area" class="rA_left_label">联系人姓名</label>
                            <input type="text" placeholder="请输入联系人姓名" class="rA_right_input email" name="contact" value="" reqiured id="contact_name">
                            <p class="regAccountToggle">请输入有效的联系人姓名</p>
                        </div>
                        <div class="regAccount_form regAccount_form1">
                            <label for="area" class="rA_left_label">邮箱</label>
                            <input type="email" placeholder="请输入电子邮箱" class="rA_right_input email" name="email" value="{{ old('email') }}" reqiured id="email">
                            <p class="regAccountToggle">请输入有效的E_mail</p>
                            <p class="regAccountPrompt">请输入正确的E_mail !(xxx@xx.xxx)</p>
                        </div>
                        <div class="regAccount_form regAccount_form1">
                            <label for="area" class="rA_left_label">手机号</label>
                            <input type="text" placeholder="请输入手机号" class="rA_right_input email" id="mobile" name="mobile"  reqiured >
                            <p class="regAccountToggle">请输入有效的手机号</p>
                            <p class="regAccountPrompt">请输入正确的手机号 !</p>
                        </div>
                        <div class="regAccount_form regAccount_form1">
                            <label for="area" class="rA_left_label">短信验证码</label>
                            <span><input type="text" placeholder="请输入短信验证码" id="rA_right_input" name="sms"  reqiured ></span>
                            <span style="margin-right: 280px"><button type="button" id="regAccount_next">获取短信验证码</button></span>
                        </div>
                        <div class="regAccount_form">
                            <label for="input" class="rA_left_label" >验证码</label>
                            <input style="margin-right:10px;" type="text" placeholder="请输入验证码" class="rA_right_input" id="input"  name="captcha" reqiured>
                            <img onclick="this.src='{{ captcha_src('flat') }}#'+Math.random();" src="{{ captcha_src('flat') }}" alt="captcha" >

                            <!-- <p class="regAccountToggle">请输入左图中的字符，不区分大小写</p> -->
                        </div>
                        <div class="regAccount_form regAccount_agree">
                            <input type="checkbox" class="agreee_protocol_check" checked="checked" name="is_agree" value="1">
                            <label for="" class="agreee_protocol">我同意<a href="">《不去服务协议》</a></label>
                        </div>
                        <div class="regAccount_form">
                            <input type="submit" value="下一步" class="regAccount_next" onclick="validate()">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </main>
</body>
<script src="{{asset('js/index/jquery.js')}}"></script>
<!--<script src="../js/test.js"></script>-->
<script src="{{asset('js/register/register.js')}}"></script>
<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
</script>
<script>
    $(function(){
    	var countdown=60;
    	var inter;
    	function timer(){
		   if(inter!=null){
		      clearInterval(inter);
		      inter = null;
		   }
		   inter = setInterval(function(){

		   	if(countdown<0){
		   		clearInterval(inter);
				 countdown=60;
				 $("#regAccount_next").html("获取短信验证码");
				 $("#regAccount_next").attr("disabled",false);
            	 $("#regAccount_next").css("backgroundColor","#ff5d5b")
		     }
		      $("#info_time").text(countdown);

		      countdown--;

		   	},1000)
		}
        $('#regAccount_next').click(function(){
            if($('#mobile').val()==''){
                alert('请填写手机号');
                return false;
            }else{
                var mobile =$('#mobile').val();
                var firm = $('#firm').val();
                var email=$('#email').val();
                $.ajaxSetup({
                    async : false
                });
                var ajax=$.post('/sms1',{mobile:mobile,firm:firm,email:email},function(e){
                    if(e.status>0){
                        alert(e.info);
                        return false;
                    }
                    timer();
                    $("#regAccount_next").attr("disabled",true);
                    $("#regAccount_next").css("backgroundColor","#ccc");
                    $("#regAccount_next").html("验证码倒计时<span id='info_time'></span>")

                });
                ajax.error(function(err){
                    var error=JSON.parse(err.responseText);
                    $.each(error,function(k,j){
                        $('#err').append('<p>'+j+'</p>');
                    });
                });
            }

        });

    })
</script>
</html>
